SRCS = $(wildcard *.cpp)
SRCS += $(wildcard *.c)
TARGETS = $(foreach src, $(SRCS), $(basename $(src)) )

CXX=g++
CFLAGS += -pipe -Wall -g -std=c++0x -ftemplate-depth-2000

CFLAGS += $(shell xml2-config --cflags)
CDFLAGS += -lm -lrt -lpcre -lpthread
CDFLAGS += $(shell xml2-config --libs)
CDFLAGS += -lssl

.PHONY : all clean

all : $(TARGETS)

$(TARGETS) : % : %.o 
	    g++ $(CFLAGS) -o $@ $< $(CDFLAGS)


clean :
	    -rm $(TARGETS) *.o

##################################

.SUFFIXES : .cpp .c
.cpp.o :
	    $(CXX) $(CFLAGS) -c -o $@ $<

.c.o :
	    $(CXX) $(CFLAGS) -c -o $@ $<
